//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.restaurant.application.indexes.genshanguserList.support;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import java.util.List;

public class SearchData implements PickableBean {
    public static final String FN_NAME = "name";
    public static final String FN_NUMBER = "number";
    public static final String FN_PHONE = "phone";
    public static final String FN_PAGE = "page";
    public static final List<String> FIELD_NAMES = Lists.newArrayList(new String[]{"name", "number", "phone", "page"});
    private String name;
    private String number;
    private String phone;
    private Integer page;

    public SearchData(String name, String number, String phone, Integer page) {
        this.setName(name);
        this.setNumber(number);
        this.setPhone(phone);
        this.setPage(page);
    }

    public SearchData() {
    }

    public SearchData duplicate() {
        SearchData result = new SearchData();
        result.name = this.name;
        result.number = this.number;
        result.phone = this.phone;
        result.page = this.page;
        return result;
    }

    public String toString() {
        return Convert.toJson(this);
    }

    public String getName() {
        return this.name;
    }

    public void setName(String value) {
        this.name = value;
    }

    public SearchData withName(String value) {
        this.setName(value);
        return this;
    }

    public SearchData withName(String value, String defaultValue) {
        this.setName(value == null ? defaultValue : value);
        return this;
    }

    public String getNumber() {
        return this.number;
    }

    public void setNumber(String value) {
        this.number = value;
    }

    public SearchData withNumber(String value) {
        this.setNumber(value);
        return this;
    }

    public SearchData withNumber(String value, String defaultValue) {
        this.setNumber(value == null ? defaultValue : value);
        return this;
    }

    public String getPhone() {
        return this.phone;
    }

    public void setPhone(String value) {
        this.phone = value;
    }

    public SearchData withPhone(String value) {
        this.setPhone(value);
        return this;
    }

    public SearchData withPhone(String value, String defaultValue) {
        this.setPhone(value == null ? defaultValue : value);
        return this;
    }

    public Integer getPage() {
        return this.page;
    }

    public void setPage(Integer value) {
        this.page = value;
    }

    public SearchData withPage(Integer value) {
        this.setPage(value);
        return this;
    }

    public SearchData withPage(Integer value, Integer defaultValue) {
        this.setPage(value == null ? defaultValue : value);
        return this;
    }

    public Object getValueOf(String name) {
        byte var3 = -1;
        switch(name.hashCode()) {
            case -1034364087:
                if (name.equals("number")) {
                    var3 = 1;
                }
                break;
            case 3373707:
                if (name.equals("name")) {
                    var3 = 0;
                }
                break;
            case 3433103:
                if (name.equals("page")) {
                    var3 = 3;
                }
                break;
            case 106642798:
                if (name.equals("phone")) {
                    var3 = 2;
                }
        }

        switch(var3) {
            case 0:
                return this.getName();
            case 1:
                return this.getNumber();
            case 2:
                return this.getPhone();
            case 3:
                return this.getPage();
            default:
                return null;
        }
    }

    public void setValueOf(String name, Object value) {
        byte var4 = -1;
        switch(name.hashCode()) {
            case -1034364087:
                if (name.equals("number")) {
                    var4 = 1;
                }
                break;
            case 3373707:
                if (name.equals("name")) {
                    var4 = 0;
                }
                break;
            case 3433103:
                if (name.equals("page")) {
                    var4 = 3;
                }
                break;
            case 106642798:
                if (name.equals("phone")) {
                    var4 = 2;
                }
        }

        switch(var4) {
            case 0:
                this.setName((String)value);
                return;
            case 1:
                this.setNumber((String)value);
                return;
            case 2:
                this.setPhone((String)value);
                return;
            case 3:
                this.setPage((Integer)value);
                return;
            default:
        }
    }

    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }

    public int hashCode() {
        return this.signature().hashCode();
    }

    public boolean equals(Object o) {
        return !(o instanceof SearchData) ? false : this.signature().equals(((SearchData)o).signature());
    }

    public String signature() {
        throw new RuntimeException("Bean SearchData has no signature defined, no hash code or equals possible.");
    }
}
